 <template>
	 <!-- <web-view src="https://test.p.ynz666.com/purchase/index.html#/map/index?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVaWQiOjE1MTIzMTk5NTY5NTQ0MTEwMDgsIklhdCI6MTY1ODQ5MTk2NCwiRXhwIjoxNjU4NTc4MzY0fQ.H3_Wco-RPRtNnN6ONjT5MWsEhAF-AiE7DknvZxB6rJY&buyVipLevel=1"></web-view> -->
	 <web-view :src="webUrl"></web-view>
 </template>
 
<script>
	export default {
		data() {
			return {
				shareTxt:[
					'神奇！每月花55块9居然可以玩深圳200家运动场馆',
					'@你，我花55.9居然玩遍了深圳200家运动场馆',
					'只告诉你，打卡人生100种体验居然只花了55.9'
				],
				webUrl:'',
			}
		},
		onLoad(options) {
			console.log(options,"options")
			if(options&&options.url){
				let url = decodeURIComponent(options.url);
				uni.setStorageSync('webUrl',url)
				this.webUrl = url;
			}else{
				let url=uni.getStorageSync('webUrl',url)
				this.webUrl = url;
			}
		},
		onShow(){
			console.log(uni.getStorageSync('webUrl'),'111')
			console.log(this.webUrl,'111')
			if(this.webUrl==''){
				console.log(uni.getStorageSync('webUrl'),"11")
				this.webUrl = uni.getStorageSync('webUrl');
			}
		},
		onShareAppMessage() {
			let shareTitle = '';
			if(this.webUrl.indexOf('https://test.p.xiuxian.xialoukeji.com/purchase/index.html#/home/index')>=0){
				shareTitle =  this.shareTxt[Math.floor(Math.random()*3)];
			}else{
				shareTitle =  '下楼休闲吧';
			}
			return{
				path:'/pages/agreement/agreement?url='+ encodeURIComponent(this.webUrl),
				title:shareTitle,
			}
		},
	}
</script>

<style>

</style>